package cn.jly.spring.boot.cloud.utils;

/**
 * @author lanyangji
 * @description 响应json实体类
 * @date 2020/11/23 下午 8:39
 */
public class ResultBase {
    private int code;
    private String msg;
    private Object data;

    private ResultBase(){}

    private ResultBase(int code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public static ResultBase build(int code, String msg, Object data){
        return new ResultBase(code, msg, data);
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

    public Object getData() {
        return data;
    }

    @Override
    public String toString() {
        return "ResultBase{" +
                "code=" + code +
                ", msg='" + msg + '\'' +
                ", data=" + data +
                '}';
    }
}
